Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.wpi.cetask
Class Utils

    java.lang.Object
      edu.wpi.cetask.Utils

    public abstract class Utils

extends Object

Method Summary
`static String` | `decapitalize(String string)` Return (possibly copy of) given string with first character lower case.
`static String` | `emptyNull(String string)` Return null if given string is empty, otherwise string.
`static boolean` | `equals(Object object1, Object object2)` Test whether given objects are either both null or `java.lang#equal(Object,Object)`.
`static boolean` | `isFalse(Boolean b)`
`static boolean` | `isTrue(Boolean b)`
`static String` | `replaceEndsWith(String string, String from, String to)` If given string ends with 'from' string, replace ending with 'to' string; otherwise just append 'to' string.
`static URL` | `toURL(String source)` Convert the given source string to a URL.
`static boolean` | `validate(String uri)` Validate given task model description against CEA-2018 RelaxNG schema (http://ce.org/cea-2018/rnc).

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### validate

    public static boolean validate(String uri)

  Validate given task model description against CEA-2018 RelaxNG schema (http://ce.org/cea-2018/rnc). Validation can also be run stand-alone at command line as in:
  `java -jar lib/jing.jar -c java/edu/wpi/cetask/CEA-2018.rnc MyModel.xml`

  Parameters:
    `uri` - of xml file to validate
  Returns:
    true iff file is valid

### isTrue

    public static boolean isTrue(Boolean b)

### isFalse

    public static boolean isFalse(Boolean b)

### equals

    public static boolean equals(Object object1,
                                 Object object2)

  Test whether given objects are either both null or `java.lang#equal(Object,Object)`.

### emptyNull

    public static String emptyNull(String string)

  Return null if given string is empty, otherwise string.

### toURL

    public static URL toURL(String source)
                     throws MalformedURLException

  Convert the given source string to a URL. If given string is not a well-formed URL, then see if it names a system resource; otherwise treat it as a filename.

  Throws:
    `MalformedURLException`

### replaceEndsWith

    public static String replaceEndsWith(String string,
                                         String from,
                                         String to)

  If given string ends with 'from' string, replace ending with 'to' string; otherwise just append 'to' string.

### decapitalize

    public static String decapitalize(String string)

  Return (possibly copy of) given string with first character lower case.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD